import 'package:flutter/material.dart';

class RegisterPage5 extends StatefulWidget {
  const RegisterPage5({Key? key}) : super(key: key);

  @override
  _RegisterPageState5 createState() => _RegisterPageState5();
}

class _RegisterPageState5 extends State<RegisterPage5>{
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('钱包'),
        backgroundColor: Colors.purple,
        elevation: 0, // 移除阴影
      ),
      body: Column(
        children: [
          Expanded(
            child: ListView.builder(
              itemCount: 10, // 假设有10个订单
              itemBuilder: (BuildContext context, int index) {
                return Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Card(
                    elevation: 4.0,
                    child: Column(
                      children: [
                        ListTile(
                          leading: Icon(
                            Icons.shopping_cart,
                            color: Colors.purple[500], // 图标颜色为紫色
                          ),
                          title: Text('商品名称 ${index + 1}'),
                          subtitle: Text('商品种类'),
                        ),
                        Divider(thickness: 1.0, color: Colors.grey[300]),
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('购买时间：2023-04-${index + 1}'),
                            Text('购买状态：已支付'),
                          ],
                        ),
                        Divider(thickness: 1.0, color: Colors.grey[300]),
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('购买金额：￥${(index + 1) * 100.0}'),
                            Text('购买量：${index + 1}'),
                          ],
                        ),
                      ],
                    ),
                  ),
                );
              },
            ),
          ),
        ],
      ),
      bottomNavigationBar: BottomNavigationBar(
        showSelectedLabels: true,
        // 如果想要隐藏选中时的文字
        showUnselectedLabels: true,
        // 如果想要显示未选中时的文字
        type: BottomNavigationBarType.fixed,

        selectedItemColor: Colors.purple,
        // 选中项的颜色
        unselectedItemColor: Colors.grey,
        // 未选中项的颜色

        items: const <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: Icon(Icons.shopping_bag),
            label: '购买记录',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            label: '首页',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.face),
            label: '我的',
          ),
        ],
      ),
    );
  }
}



